package com.mavenq.fly.test;

import java.util.*;
import java.util.stream.*;

public class StringObjectMapExample {
    public static void main(String[] args) {
        // 使用 Stream 直接创建
        Map<String, Object> hourMap = IntStream.rangeClosed(1, 23)
                .boxed()
                .collect(Collectors.toMap(
                        hour -> String.format("%d", hour),  // String key
                        hour -> (Object) hour,              // Object value
                        (k, v) -> k,
                        LinkedHashMap::new
                ));

        System.out.println("Stream创建的Map: " + hourMap);
    }
}